#ifndef WORLD_H
#define WORLD_H

#include <chipmunk/chipmunk.h>
#include <vector>
#include "Vectors.h"
#include "Entity.h"


namespace me
{

    class World
    {
        public:
            World(std::string name, me::Vector2f size, me::Vector2f tileSize = me::Vector2f(1.0f, 1.0f), cpVect gravity = cpv(0, 0));
            virtual ~World();

            void update();

            void addEntity(me::Entity* entity);
            void addEntity(me::PhysicalEntity* entity);
            void setTileSize(me::Vector2f tileSize);
            void clear();

            std::string getName();
            me::Entity* getEntityAtPos(me::Vector2f pos);
            me::Vector2f getTileSize();
            cpSpace* getSpace();

            std::vector<me::Entity*> getEntities();
        protected:
            std::string m_name;
        	me::Vector2f m_size;
        	me::Vector2f m_tileSize;
        	cpShape* test;
        	cpShape* m_borders[4];
        	cpSpace* m_space;
        	std::vector<me::Entity*> m_entities;
        private:
    };

}

#endif // WORLD_H
